import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  // {
  //   title: '订单ID',
  //   align: "center",
  //   dataIndex: 'orderId'
  // },
  {
    title: '生产计划编号',
    align: "center",
    dataIndex: 'code',
    width: 110
  },
  {
    title: '产品名称',
    align: "center",
    dataIndex: 'orderProduct',
    width: 120
  },
  {
    title: '产量（L）',
    align: "center",
    dataIndex: 'orderNum',
    width: 85
  },
  {
    title: '生产状态',
    align: "center",
    dataIndex: 'processStatus',
    width: 75
  },
  
  {
    title: '原料',
    align: "center",
    dataIndex: 'materialIds_dictText',
    width: 110
  },
  {
    title: '工艺',
    align: "center",
    dataIndex: 'crafts_dictText',
    width: 110
  },
  {
    title: '机器',
    align: "center",
    dataIndex: 'machines_dictText',
    width: 110
  },
  {
    title: '生产员工',
    align: "center",
    dataIndex: 'executor_dictText',
    width: 80
  },
  {
    title: '负责人',
    align: "center",
    dataIndex: 'principal_dictText',
    width: 80
  },
  // {
  //   title: '用时（H）',
  //   align: "center",
  //   dataIndex: 'timeRequired'
  // },
  {
    title: '预计开始时间',
    align: "center",
    dataIndex: 'estStartTime',
    width: 105
  },
  {
    title: '预计结束时间',
    align: "center",
    dataIndex: 'estEndTime',
    width: 105
  },
  // {
  //   title: '实际开始时间',
  //   align: "center",
  //   dataIndex: 'realStartTime'
  // },
  // {
  //   title: '实际结束时间',
  //   align: "center",
  //   dataIndex: 'realEndTime'
  // },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "生产计划编号",
    field: 'code',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "产品名称",
    field: 'orderProduct',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  // {
  //   label: '订单ID',
  //   field: 'orderId',
  //   component: 'Input',
  //   dynamicDisabled: true
  // },
  {
    label: '生产计划编号',
    field: 'code',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '产品名称',
    field: 'orderProduct',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '生产量',
    field: 'orderNum',
    component: 'InputNumber',
  },
  {
    label: '生产状态',
    field: 'processStatus',
    component: 'InputNumber',
    dynamicDisabled: true
  },
  {
    label: '计划用时',
    field: 'timeRequired',
    component: 'InputNumber',
    dynamicDisabled: true
  },
  {
    label: '原料',
    field: 'materialIds',
    component: 'JSelectMultiple',
    componentProps:{
      dictCode: "camellia_mes_raw,name,id"
    },
  },
  {
    label: '工艺',
    field: 'crafts',
    component: 'JSelectMultiple',
    componentProps:{
      dictCode: "camellia_mes_process_craft,craft_name,id"
    },
  },
  {
    label: '机器',
    field: 'machines',
    component: 'JSelectMultiple',
    componentProps:{
      dictCode: ""
    },
  },
  {
    label: '生产员工',
    field: 'executor',
    component: 'JSelectMultiple',
    componentProps:{
      dictCode: "camellia_mes_empployee,name,id"
    },
  },
  {
    label: '负责人',
    field: 'principal',
    component: 'JSelectMultiple',
    componentProps:{
      dictCode: "camellia_mes_empployee,name,id"
    },
  },
  {
    label: '预计开始时间',
    field: 'estStartTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicDisabled: true
  },
  {
    label: '预计结束时间',
    field: 'estEndTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    dynamicDisabled: true
  },
  {
    label: '实际开始时间',
    field: 'realStartTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '实际结束时间',
    field: 'realEndTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
